package com.mcy.test01.dao;

import com.mcy.test01.pojo.Deparment;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.Map;

//部门dao
public class DepartmentDao {
    //模拟数据查询
    private static Map<Integer, Deparment> departments=null;
    static {
        departments.put(101,new Deparment(101,"教学部"));
        departments.put(102,new Deparment(102,"市场部"));
        departments.put(103,new Deparment(103,"教研部"));
    }
    //获得所有部门信息
    public Collection<Deparment> getAllDeparment(){
        return  departments.values();
    }
    //通过id获取部门信息
    public Deparment getDepartmentById(Integer id){
        return  departments.get(id);
    }


}
